/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       texturedmaterial.h
 * Author:     karooolek
 * Created on: 2009-03-14
 *
 **********************************************************************************************************************/

#ifndef TEXTUREDMATERIAL_H_
#define TEXTUREDMATERIAL_H_

#include "standardmaterial.h"
#include "texture.h"

namespace mGameEngine
{
namespace Graphics
{

/**
 * Standard material with decal texture.
 */
class TexturedMaterial : public StandardMaterial
{
protected:
    /**
     * Material texture
     */
    const Texture *_texture;

public:
    /**
     * Create new textured material from texture and colors.
     * @param texture texture
     * @param ambient ambient color
     * @param diffuse diffuse color
     * @param specular specular color
     * @param shininess shininess
     * @param emissive emissive color
     */
    TexturedMaterial(const Texture *texture = NULL,
                     const Color &ambient = Color(1.0f, 1.0f, 1.0f),
                     const Color &diffuse = Color(1.0f, 1.0f, 1.0f),
                     const Color &specular = Color(0.0f, 0.0f, 0.0f),
                     float shininess = 0.0f,
                     const Color &emissive = Color(0.0f, 0.0f, 0.0f));

    /**
     * Destroy textured material.
     */
    virtual ~TexturedMaterial();

    /**
     * Get material texture.
     * @return material texture
     */
    const Texture *getTexture() const
    {
        return _texture;
    }

    /**
     * Set material texture.
     * @param texture material texture
     */
    void setTexture(const Texture *texture)
    {
        _texture = texture;
    }

    /**
     * Set textured material as active.
     */
    void set() const;
};

}
}

#endif // TEXTUREDMATERIAL_H_
